import 'package:flutter/material.dart';
import 'services/http_service.dart';
import 'services/gitcode_api_service.dart';
import 'pages/home_page.dart';

void main() {
  runApp(const GitCodePocketToolApp());
}

class GitCodePocketToolApp extends StatelessWidget {
  const GitCodePocketToolApp({super.key});

  @override
  Widget build(BuildContext context) {
    // 初始化服务
    final httpService = HttpService();
    final apiService = GitCodeApiService(httpService);
    
    return MaterialApp(
      title: 'GitCode 口袋工具',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          seedColor: Colors.blue,
          brightness: Brightness.light,
        ),
        useMaterial3: true,
        cardTheme: CardThemeData(
          elevation: 2,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(12),
          ),
        ),
      ),
      home: HomePage(
        httpService: httpService,
        apiService: apiService,
      ),
    );
  }
}
